solving equations using u substitution method